<template>
	<view>
		<view>
			<view class="box-top-x">
				<text>用户ID</text>
				<text>用户名称</text>
				<text>时间</text>
			</view>
			<view class="nodata" v-if="!billList.length">
				<image mode="aspectFit" src="https://iflytts.oss-cn-qingdao.aliyuncs.com/wxapp/xze/3.png"></image>
				<view class="photo-text">您还没有邀请~</view>
			</view>
			<view v-else style="width: 100%">
				<view class="bill" v-for="(item, index) in billList" :key="index" :class="{'odd': (index % 2) === 1}">
					<view class="bill_content">
						<view class="bill_content-son1">{{ item.userid }}</view>
						<view class="bill_content-son2">{{ item.name?item.name:'未知' }}</view>
						<view class="bill_content-son3">{{ item.time }}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		sslbizUrl,
		apiMixUrlKeyApi
	} from '../../api/assemb.js'
	export default {
		data() {
			return {
				billList: []
			};
		},
		onLoad() {
			this.fetchBills();
			this.loadpeople();
		},
		methods: {
			fetchBills() {
				var self = this;
				var app = getApp();
			},
			loadpeople() {
				var self = this
				var baseinfo = uni.getStorageSync("baseinfo");
				let timestamp = Date.parse(new Date()) / 1000;
				baseinfo.timestamp = timestamp;
				var prams = {
					base: baseinfo,
				};
				apiMixUrlKeyApi(prams, '1054', 'GetInviteRecord').then(res => {
					console.log('res', res)
					this.billList = res.data.history
				})
			},
		}
	};
</script>

<style lang="scss" scoped>
	.box-top-x {
		display: flex;
		width: 750rpx;
		height: 72rpx;
		color: #333333;
		background: #F5F5F5;
		justify-content: space-around;
		align-items: center;
	}

	.bill {
		width: 90%;
		margin: 0px auto;
	}


	.bill_content {
		margin: 0rpx auto;
		padding: 20rpx 0rpx;
		color: #333333;
		display: flex;
		font-size: 30rpx;
		min-height: 50rpx;

		.bill_content-son1 {
			width: 30%;
			text-align: center;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.bill_content-son2 {
			width: 40%;
			text-align: center;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.bill_content-son3 {
			width: 30%;
			text-align: center;
			display: flex;
			justify-content: center;
			align-items: center;
		}
	}

	.odd {
		background-color: #f7f7f7;
	}

	.nodata {
		width: 100%;
		height: calc(100vh - 72rpx);
		display: flex;
		justify-content: center;
		align-items: center;
		position: relative;
	}

	.photo {
		width: 400rpx;
	}

	.photo-text {
		position: absolute;
		top: 55%;
		left: 50%;
		transform: translate(-50%, -50%);
		z-index: 10;
		color: #6A7588;
	}
</style>